// To parse this JSON data, do
//
//     final multiSelectListBean = multiSelectListBeanFromJson(jsonString);

import 'dart:convert';

import 'package:common/mvp/model/base_multi_select_bean.dart';

MultiSelectListBean multiSelectListBeanFromJson(String str) => MultiSelectListBean.fromMap(json.decode(str));

String multiSelectListBeanToJson(MultiSelectListBean data) => json.encode(data.toMap());

class MultiSelectListBean {
  int total;
  List<MultiSelectListRowBean> rows;

  MultiSelectListBean({
    required this.total,
    required this.rows,
  });

  factory MultiSelectListBean.fromMap(Map<String, dynamic> json) => MultiSelectListBean(
    total: json["total"],
    rows: List<MultiSelectListRowBean>.from(json["rows"].map((x) => MultiSelectListRowBean.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "total": total,
    "rows": List<dynamic>.from(rows.map((x) => x.toMap())),
  };
}

class MultiSelectListRowBean extends BaseMultiSelectBean{
  dynamic pageSize;
  dynamic pageNumber;
  dynamic orderBy;
  dynamic sort;
  dynamic findAll;
  String intelligentId;
  dynamic eventTypeid;
  EventName eventName;
  dynamic eventNameList;
  dynamic eventType;
  dynamic eventTypeList;
  dynamic eventColorLabel;
  dynamic eventColorLabelList;
  String eventSourcet;
  ReportVideocode reportVideocode;
  String reportVideoName;
  EventPlace eventPlace;
  String coordinatesX;
  String coordinatesY;
  dynamic deviceType;
  EventGroupName eventGroupName;
  dynamic eventGroupid;
  dynamic eventGroupcode;
  String reportTime;
  String misreportFlag;
  String reportFlag;
  String readFlag;
  String pushId;
  dynamic eventId;
  EventAreaName eventAreaName;
  dynamic eventAreaCode;
  EventCommunity eventCommunity;
  AllGroupName allGroupName;
  String attachmentUrl;
  String attachmentUrlPublic;
  String attachmentName;

  MultiSelectListRowBean({
    this.pageSize,
    this.pageNumber,
    this.orderBy,
    this.sort,
    this.findAll,
    required this.intelligentId,
    this.eventTypeid,
    required this.eventName,
    this.eventNameList,
    this.eventType,
    this.eventTypeList,
    this.eventColorLabel,
    this.eventColorLabelList,
    required this.eventSourcet,
    required this.reportVideocode,
    required this.reportVideoName,
    required this.eventPlace,
    required this.coordinatesX,
    required this.coordinatesY,
    this.deviceType,
    required this.eventGroupName,
    this.eventGroupid,
    this.eventGroupcode,
    required this.reportTime,
    required this.misreportFlag,
    required this.reportFlag,
    required this.readFlag,
    required this.pushId,
    this.eventId,
    required this.eventAreaName,
    this.eventAreaCode,
    required this.eventCommunity,
    required this.allGroupName,
    required this.attachmentUrl,
    required this.attachmentUrlPublic,
    required this.attachmentName,
  }) :super(false,false);

  factory MultiSelectListRowBean.fromMap(Map<String, dynamic> json) => MultiSelectListRowBean(
    pageSize: json["pageSize"],
    pageNumber: json["pageNumber"],
    orderBy: json["orderBy"],
    sort: json["sort"],
    findAll: json["findAll"],
    intelligentId: json["intelligentId"],
    eventTypeid: json["eventTypeid"],
    eventName: eventNameValues.map[json["eventName"]]!,
    eventNameList: json["eventNameList"],
    eventType: json["eventType"],
    eventTypeList: json["eventTypeList"],
    eventColorLabel: json["eventColorLabel"],
    eventColorLabelList: json["eventColorLabelList"],
    eventSourcet: json["eventSourcet"],
    reportVideocode: reportVideocodeValues.map[json["reportVideocode"]]!,
    reportVideoName: json["reportVideoName"],
    eventPlace: eventPlaceValues.map[json["eventPlace"]]!,
    coordinatesX: json["coordinatesX"],
    coordinatesY: json["coordinatesY"],
    deviceType: json["deviceType"],
    eventGroupName: eventGroupNameValues.map[json["eventGroupName"]]!,
    eventGroupid: json["eventGroupid"],
    eventGroupcode: json["eventGroupcode"],
    reportTime: json["reportTime"],
    misreportFlag: json["misreportFlag"],
    reportFlag: json["reportFlag"],
    readFlag: json["readFlag"],
    pushId: json["pushId"],
    eventId: json["eventId"],
    eventAreaName: eventAreaNameValues.map[json["eventAreaName"]]!,
    eventAreaCode: json["eventAreaCode"],
    eventCommunity: eventCommunityValues.map[json["eventCommunity"]]!,
    allGroupName: allGroupNameValues.map[json["allGroupName"]]!,
    attachmentUrl: json["attachmentUrl"],
    attachmentUrlPublic: json["attachmentUrlPublic"],
    attachmentName: json["attachmentName"],
  );

  Map<String, dynamic> toMap() => {
    "pageSize": pageSize,
    "pageNumber": pageNumber,
    "orderBy": orderBy,
    "sort": sort,
    "findAll": findAll,
    "intelligentId": intelligentId,
    "eventTypeid": eventTypeid,
    "eventName": eventNameValues.reverse[eventName],
    "eventNameList": eventNameList,
    "eventType": eventType,
    "eventTypeList": eventTypeList,
    "eventColorLabel": eventColorLabel,
    "eventColorLabelList": eventColorLabelList,
    "eventSourcet": eventSourcet,
    "reportVideocode": reportVideocodeValues.reverse[reportVideocode],
    "reportVideoName": reportVideoName,
    "eventPlace": eventPlaceValues.reverse[eventPlace],
    "coordinatesX": coordinatesX,
    "coordinatesY": coordinatesY,
    "deviceType": deviceType,
    "eventGroupName": eventGroupNameValues.reverse[eventGroupName],
    "eventGroupid": eventGroupid,
    "eventGroupcode": eventGroupcode,
    "reportTime": reportTime,
    "misreportFlag": misreportFlag,
    "reportFlag": reportFlag,
    "readFlag": readFlag,
    "pushId": pushId,
    "eventId": eventId,
    "eventAreaName": eventAreaNameValues.reverse[eventAreaName],
    "eventAreaCode": eventAreaCode,
    "eventCommunity": eventCommunityValues.reverse[eventCommunity],
    "allGroupName": allGroupNameValues.reverse[allGroupName],
    "attachmentUrl": attachmentUrl,
    "attachmentUrlPublic": attachmentUrlPublic,
    "attachmentName": attachmentName,
  };
}

enum AllGroupName { THE_1 }

final allGroupNameValues = EnumValues({
  "北京保障房中心/应急指挥信息中心/安全应急部/运营主体1号/乐活雅苑": AllGroupName.THE_1
});

enum EventAreaName { EMPTY }

final eventAreaNameValues = EnumValues({
  "北京市/乐活雅苑": EventAreaName.EMPTY
});

enum EventCommunity { XQ000104 }

final eventCommunityValues = EnumValues({
  "XQ000104": EventCommunity.XQ000104
});

enum EventGroupName { EMPTY }

final eventGroupNameValues = EnumValues({
  "乐活雅苑": EventGroupName.EMPTY
});

enum EventName { EMPTY }

final eventNameValues = EnumValues({
  "电子围栏": EventName.EMPTY
});

enum EventPlace { EMPTY }

final eventPlaceValues = EnumValues({
  "北京市朝阳区崔各庄乡黄胖子建材批发": EventPlace.EMPTY
});

enum ReportVideocode { EF5_A1_B409739463_AB9_A3_BD9_FBF3431_EB_0000 }

final reportVideocodeValues = EnumValues({
  "ef5a1b409739463ab9a3bd9fbf3431eb-0000": ReportVideocode.EF5_A1_B409739463_AB9_A3_BD9_FBF3431_EB_0000
});


class EnumValues<T> {
  Map<String, T> map;
  late Map<T, String> reverseMap;

  EnumValues(this.map);

  Map<T, String> get reverse {
    reverseMap = map.map((k, v) => MapEntry(v, k));
    return reverseMap;
  }
}
